package com.example.oasystem.dao.plan;

import com.example.oasystem.entity.dept.AoaDept;
import com.example.oasystem.entity.plan.AoaPlanList;
import com.example.oasystem.entity.status.AoaStatusList;
import com.example.oasystem.entity.type.AoaTypeList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AoaPlanListDao {
    int deleteByPrimaryKey(Long planId);

    int insert(AoaPlanList record);

    int insertSelective(AoaPlanList record);

    AoaPlanList selectByPrimaryKey(Long planId);

    int updateByPrimaryKeySelective(AoaPlanList record);

    int updateByPrimaryKey(AoaPlanList record);

    List<AoaPlanList>plans(@Param("planUserId") Long planUserId,@Param("baseKey")String baseKey);

    List<AoaPlanList> myPlans(@Param("planUserId") Long planUserId,
                              @Param("baseKey")String baseKey,
                              @Param("type")Integer type,
                              @Param("time")Integer time,
                              @Param("status")Integer status,
                              @Param("order")String order);

    @Select("select * from aoa_dept where dept_id = #{deptId}")
    AoaDept dept(Long deptId);

    @Select("select * from aoa_type_list where type_model='aoa_plan_list'")
    List<AoaTypeList>typeList();

    @Select("select * from aoa_status_list where status_model='aoa_plan_list'")
    List<AoaStatusList>statusList();
}